package com.hundsun.data;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.annotation.MapperScans;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author pw
 */
@SpringBootApplication
@Slf4j
@MapperScan(value = {"com.hundsun.data.mapper"})
public class DataAnalyseApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext run = SpringApplication.run(DataAnalyseApplication.class, args);
        Environment env = run.getEnvironment();
        log.info("----------------------------------------------------------------------------------------------\t\n"
                        +"                    application is {}\t\t\n"
                        +"                    local:   \t\thttp://localhost:{}\t\t\n"
                        +"                    external:\t\thttp://{}:{}\t\t\n"
                        +"----------------------------------------------------------------------------------------------\t\n",
                env.getProperty("spring.application.name"),env.getProperty("server.port"), InetAddress.getLocalHost().getHostAddress(),env.getProperty("server.port"));
    }

}
